<script>
    function initPurchaseField(){
        if($("#shopping_cart_setting-1").attr("checked") == "checked"){
            $("#purchase_info").attr('disabled', "disabled");
        } else {
            $("#purchase_info").removeAttr('disabled')
        }
    }
	jQuery("document").ready(function($){
		$('#<?php echo $this->form->getId() ?>').ymFormHandle({
			'tiny_mce_url':'<?php echo REPOSITORY_URL.'/javascript/tiny_mce/tiny_mce.js' ?>',
			'cancel-url':'<?php echo $this->form->getCancelUrl() ?>',
			'get-system-categories-url': '<?php echo $this->url(array('controller' => 'product','action' => 'get-system-categories')) ?>',
			'label' : {
				'select': '<?php echo $this->translate('SELECT') ?>'
			}
		});	
        
        initPurchaseField();
        $("#shopping_cart_setting-1").click(function(){
            initPurchaseField();
        });
		
		$("#<?php echo $this->form->getId()?>").ymHandleFanpages({
			selector			: '#fanpages-label+dd',
			pageName			: '<?php echo Store_Form_Store::FANPAGE_NAME ?>',
			confirmTitle		: '<?php echo $this->translate('Confirm this aciton') ?>',
			confirmTemplate		: '<?php echo YouNet_Util::htmlToJs($this->social->render('dialogAskPageInstall',array('app_name'=>'Coupon'))) ?>',
			translate			: {
				LOAD_MY_FAN_PAGES	: '<?php echo $this->translate('LOAD_MY_FANPAGES') ?>',
				CREATE_A_PAGE		: '<?php echo $this->translate('CREATE_A_PAGE') ?>'
			}
		});
		
		$('input[name="store_layout[]"]').change();
		$('#name').focus();
	});
	<?php if( $this->form->hasStore() ): ?>
		addTab("<?php echo $this->translate('EDIT_STORE_LABEL') ?>: <?php echo Core_Util::escapeForJS($this->form->getStore()->getName()) ?>",'javascript:void(0);')
	<?php endif;?>
</script>
<?php if($this->action == 'edit'):?>
<table border="0" class="bread-crumb">
	<tr>
		<td ><?php echo $this->partial('breadcrum-menu.phtml', array('new_orders' => $this->new_orders, 'id_store' => $this->store->id)) ?></td>
		<td style="text-align: right;">
			<a class="underline non_space" href="<?php echo $this->url(array('module' => 'store','controller' => 'product', 'action' => 'create', 'id_store' => $this->store->id), null, true); ?>">
				<img src="img/add.png" class="bordernone" height="11" width="11" /><?php echo $this->translate('NEW_PRODUCT_LABEL') ?>
			</a>
		</td>
	</tr>
</table>
<?php endif;?>
<?php echo $this->form ?>
